In .travis it is possible to initiate the push of a Linux build to your Launchpad repository. These instructions assume that you have a travis account and know your way around the services and basic process. Your travis account is used to confirm 'successful' builds of linux and osx, and to create Linux packages to deploy to your Launchpad.
For travis refer to Petri's post #637
Example Bottom section of the travis.yml file. Note: indentation is important in yml files, child parts MUST be indeted below the owner. This is shown below by “oauth_token:” being the owner and “secure:” being the child, notice that “secure:” is indented.
deploy:
- provider: launchpad
slug: "Your repository slug here"
oauth_token:
secure: "Your encrypted oauth_token here"
oauth_token_secret:
secure: "Your encrypted oauth_token_secret here"
skip_cleanup: true
on: # Set Deploy conditions
# Deploy only when tag is not specified
# tags: false
# or this branch
#branches:
# only:
# - master
tags: true
all_branches: true
condition: "$TRAVIS_OS_NAME = linux"
The “slug:” and “secure:” data items are in double quotes (“”).
If you want another deploy section, like git, you will need to create a new “- provider:” with the text “releases” following it. Both “- provider:” labels need to have the same indentation.
sudo apt-get update --fix-missing sudo apt-get install ruby sudo apt-get install gem ruby -v gem install travis -v 1.8.10 --no-rdoc --no-ri travis version response: 1.8.10. 225mb disk space used.
Part of the process requires the http “Post” process to acquire security tokens. The easy way to do this from a command prompt using the “curl” program. * For Linux: Your package manager should be able to install “curl” as it is a standard internet tool. * For Windows: goto this website http://techieroop.com/how-to-install-curl-on-windows-10/ and select the correct version for your setup.
Issue the following command from a command prompt.
curl --dump-header - -H "Content-Type: application/x-www-form-urlencoded" -X POST --data 'oauth_consumer_key=Travis+Deploy&oauth_signature_method=PLAINTEXT&oauth_signature=%26' https://launchpad.net/+request-token
You should receive a reply like:
HTTP/1.1 200 Ok Date: Sat, 06 Jul 2019 01:57:06 GMT Server: zope.server.http (HTTP) X-Powered-By: Zope (www.zope.org), Python (www.python.org) Content-Length: 132 X-Xss-Protection: 1; mode=block X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=15552000 Vary: Cookie,Authorization,Accept-Encoding X-Content-Type-Warning: guessed from content X-Launchpad-Revision: 19007 X-Frame-Options: SAMEORIGIN Content-Type: text/plain;charset=utf-8 oauth_token=XJwTXv9f8RRRT6TwCZ4x&oauth_token_secret=lbrXHsQ0jVlJlqLpNX4mGWtNjcRp2rWzqhQx53KDhTM87m7f7MMGTNw7DsG3CcbhSbn3jwTCmMkFbFCG
Save this information as you will need it in following steps.
You will now need to logon to your Launchpad account. You need to have been authenticated before you can issue the next command from your browser. Open a new browser tab and enter the following in the “Address line”:
https://launchpad.net/+authorize-token?oauth_token={your oauth_token from step D:}
Your version could look like:
https://launchpad.net/+authorize-token?oauth_token=XJwTXv9f8RRRT6TwCZ4x
You will now be asked for the level of access to provide this token. The easiest is to select “All”, the last button on the page.
In your command prompt window issue the following command:
curl --dump-header - -H "Content-Type: application/x-www-form-urlencoded" -X POST --data 'oauth_signature=%26{your oauth_token_secret}&oauth_consumer_key=Travis+Deploy&oauth_token={your oauth_token}&oauth_signature_method=PLAINTEXT' https://launchpad.net/+access-token
Your version would look like“
curl --dump-header - -H "Content-Type: application/x-www-form-urlencoded" -X POST --data 'oauth_signature=%26lbrXHsQ0jVlJlqLpNX4mGWtNjcRp2rWzqhQx53KDhTM87m7f7MMGTNw7DsG3CcbhSbn3jwTCmMkFbFCG&oauth_consumer_key=Travis+Deploy&oauth_token=XJwTXv9f8RRRT6TwCZ4x&oauth_signature_method=PLAINTEXT' https://launchpad.net/+access-token
From this you would get a response like:
oauth_token=DJZmQkJ65F3M0HD4Lws5&oauth_token_secret=WbwMzlDhW3HpkHxLh7wrtkXqPZkFS8n6HHXrZXLj4WK0vKljjJqHtdx9hWmCLXJLZ0CQSc5kD8jWnsdn&lp.context=None
You should now encrypt your tokens before they are used. This makes the interaction more secure.
travis encrypt {your oauth_token from step F.> --org
travis encrypt DJZmQkJ65F3M0HD4Lws5 --org
Please add the following to your .travis.yml file: secure: "O+F3qadTm1EojsoGlopwLPirEJ8TkshlyZGOUdOa62YJsI7SrE3ugryeU2wuYHRBxE0dhXDCxHkUf+E45yq4PL8IIHx29eoygsZeVwHCgyT2nN/Pk/O/EOJXeCRo5WgrliyDnHCl4Dmz7vyRiP6svWuzz1xM6ATpKXSUlb02tdzcoydD0bzeUYwUnK2VRc7yv4Afxgr0yXx+7fdscV+ALCZ2JOvroxXWGRJawo96KWEE0On72/wiYZXeMuC7QtxFBQopSRNrmzGMTHv9F8c6cGT/Utcrp86xw42JO0pxOXCdd5i+60hzlA6QWswrNIuNBVnYWydGfJoX56bcalRZ1MEE+NyU/zHYBi8uehh8NIfUAYxdY7w7VW6FtyEdayNGWBm1FRGyyOquYfFQMGMHCBrnt30IKk2glSFWLxUBUTec4c3GGOXO8W0Zq/IhGE2ej77AVzCXgB1zOiruUSJdpkpQH73xC174SQBmiW54k76V4oRy2YyIXeibC04zKVhSpfJ0ORObvbZbz4LAgx0ML4emxFUFsIkzCNK872rEPDiUJjcL6So3bNKTrV0RC44uXN+JzFXrAeHwCZVATXANg4Ah4N94YX4W5sk0iNArhN6/p50kZbffxvZnYlPIh728BvtCFkGi5IELEeFt0Q/wE1BUr6k7ozxhGJtSTohaDb0=" Pro Tip: You can add it automatically by running with --add.
travis encrypt {your oauth_security_token from step F.> --org
travis encrypt WbwMzlDhW3HpkHxLh7wrtkXqPZkFS8n6HHXrZXLj4WK0vKljjJqHtdx9hWmCLXJLZ0CQSc5kD8jWnsdn --org
Please add the following to your .travis.yml file: secure: "zfcZagTCDKN2PrwAW4jHDMFJ40EhDwscLYguivOj+MlrI9A/Cs1v6IDjHa3Rm/v3elZuZMkZ10rZT8LUIzKaJS8MsMMU1jFnscAsqW8422S2chJlVN908T/rd0QinHotJdk1E7NbSLgHQF5J0eQ31I50kq4xWNhZ0Qe9G9FVEKi+f8HG9M3idJn0OiTJeaMqlgi6hj6X6ajgv9kaKe5qDGAWn8hB7nhav8epNCgw6zqgygKg3cTm6WF/KMLqYc6BrHruU+e3y0An9fBMD8TI0mRgHWexwkvtBOkMjBZAbO6n3hJL+cXEiUI7d+jdY9HIrWX4OjWTBXKE3jvF3SaWkqZGLj8/rRWq1TPkC8GwnDBLfiukmW2x+a982L0pxzDN5vs1XlzGMys5GzIc0TGaHSKd/BAMRXAQavcmTp9Zm51XsXismdD+CHCNm7BV7f8RaT0gWRwO+JLgT1wCsRIWoYsIVo67K2NYxgh+K3K36/8n/RjZ0y0id/+zsPZhORKsmRThFqxO9kTO0Zyi0yn6aqGks2xOGAq98BYdKiRxRlQquKk+daXhvsDCGVlCnC+8ogjvVDXSkt9bXNDW6qEcpdp4Y7v2in+KOGR1DBGXx75rB13h39ZLaeYKmnBXMncsRVYHk3MkF8mYSnu2DX/t50um/TFYwLrOb485I5tKcf4=" Pro Tip: You can add it automatically by running with --add.
When the Travis build does not work the error messages can be obscure and not really help too much. A typical message may be:
Skipping a deployment with the provider because this branch is not permitted:
This is not very helpful as it just says something went wrong not what.
: